package com.silverbox.waimai.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.silverbox.waimai.entity.GoodsCart;
import com.silverbox.waimai.entity.GoodsCartDetail;

public interface GoodsCartDetailMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(GoodsCartDetail record);

	int insertSelective(GoodsCartDetail record);

	GoodsCartDetail selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(GoodsCartDetail record);

	int updateByPrimaryKey(GoodsCartDetail record);

	/**
	 * 批量插入购物车明细
	 * 
	 * @param goodsCartDetails
	 * @return
	 */
	int insertByBatch(@Param("goodsCartDetails") List<GoodsCartDetail> goodsCartDetails,
			@Param("goodsCartId") Integer goodsCartId);

	/**
	 * 根据购物车id删除购物车明细
	 * 
	 * @param id
	 */
	void deleteGcDetailByGcId(Integer goodCartId);

	/**
	 * 根据购物车id清空购物车明细
	 * 
	 * @param goodsCartDto
	 */
	void removeGoodsCartDetail(GoodsCart goodsCart);

	//根据goodsCartId获取购物详情信息
    List<GoodsCartDetail> getGoodsCartDetailByCartId(@Param("goodsCartId") Integer goodsCartId);
}